package fr.emn.nuitinfo.model;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;
import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;

import fr.emn.nuitinfo.model.interfaces.IChasse;
import fr.emn.nuitinfo.model.interfaces.IDuree;
import fr.emn.nuitinfo.model.interfaces.IEtape;

@Entity
public class Chasse implements IChasse {

    /**
     * 
     */
    private static final long serialVersionUID = -8144173965835831985L;
    private List<IEtape>      etapes;
    private IDuree            duree;
    private List<String> 	tags;
    private String 		region;
    @Id
    private String            nom;
    private String            description;
    private List<String>      images;

    public Chasse() {
	ObjectifyService.register(getClass());
    }

    /**
     * @param etapes
     * @param duree
     * @param nom
     * @param description
     */
    public Chasse(String region, List<String> tags, List<IEtape> etapes, IDuree duree, String nom,
	    String description) {
	super();
	this.region = region;
	this.tags = tags;
	this.etapes = etapes;
	this.duree = duree;
	this.nom = nom;
	this.description = description;
	this.images = new ArrayList<String>();
    }

    @Override
    public List<IEtape> getEtapes() {
	return this.etapes;
    }

    @Override
    public IDuree getDuree() {
	return this.duree;
    }

    @Override
    public void setDuree(IDuree duree) {
	this.duree = duree;
    }

    @Override
    public String getNom() {
	return this.nom;
    }

    @Override
    public void setNom(String nom) {
	this.nom = nom;
    }

    @Override
    public String getDescription() {
	return this.description;
    }

    @Override
    public void setDescription(String description) {
	this.description = description;
    }

    @Override
    public String toString() {
	return new Gson().toJson(this);
    }

    @Override
    public void addImage(String url) {
	images.add(url);
    }

    @Override
    public List<String> getImages() {
	return this.images;
    }
    
    public void setTags(List<String> tags) {
	this.tags = tags;
    }
    
    public List<String> getTags() {
	return this.tags;
    }
    
    public String getRegion() {
	return this.region;
    }
    
    public void setRegion(String region) {
	this.region = region;
    }
}
